using DG.Tweening;
using UnityEngine;

public static class MyTools
{
	public static Vector3 F_计算抛物线锚点和曲线Ease(Vector3 抛出点, Vector3 目标点, out Ease ease)
	{
		Vector3 result = Vector3.Lerp(抛出点, 目标点, 0.5f);
		ease = Ease.OutSine;
		if (抛出点.y > 目标点.y)
		{
			result.x = 目标点.x;
			ease = Ease.InCubic;
		}
		else
		{
			result.y += Mathf.Abs(抛出点.y - 目标点.y);
		}
		return result;
	}

	public static Vector3[] F_抛物线路径(Vector3 抛出点, Vector3 锚点, Vector3 目标点, int 细节 = 10)
	{
		Vector3[] array = new Vector3[细节];
		for (int i = 0; i < 细节; i++)
		{
			array[i] = 贝塞尔曲线(抛出点, 锚点, 目标点, (float)i / (float)(细节 - 1));
		}
		return array;
	}

	public static Vector3 贝塞尔曲线(Vector3 p0, Vector3 p1, Vector3 p2, float t)
	{
		float num = 1f - t;
		return num * num * p0 + 2f * t * num * p1 + t * t * p2;
	}
}
